package cn.tedu.store.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class TimerAspect {
	
	@Around("execution(* cn.tedu.service.impl.*.*(..))")
	public void a(ProceedingJoinPoint pjp) throws Throwable {
		
		//记录起始时间
		long start = System.currentTimeMillis();
		//执行方法
		pjp.proceed();
		//记录结束时间
		long end = System.currentTimeMillis();
		//计算耗时
		System.out.println("耗时："+(end - start));
	}
}
